/**
 * 创建生成订单编号类
 * @author yanwl
 * @date 2014-09-19
 */
package com.chnbst.bstyun.core.common;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CreateOrderNum {
	
	 public static String getOrderNum(Integer userId){
		 //时间格式化
		 SimpleDateFormat date = new SimpleDateFormat("MMddyyyySSSS");
		 String dateStr = date.format(new Date());
		 String str = dateStr.substring(0, 5)+dateStr.substring(6);
		 
		 //用户编号格式化
		 DecimalFormat dl = new DecimalFormat("00000");
		 dl.setMaximumIntegerDigits(5);
		 
		 str += dl.format(userId);
		 return str;
	 }
	 
	 public static void main(String[] args) {
		System.out.println(getOrderNum(1));
	 }
}
